package com.zking.web.ZC;

import com.zking.dao.domain.Patient;
import com.zking.dao.domain.Register;
import com.zking.service.RegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Controller
@RequestMapping("/toPerson")
public class registration_Controller {
    @Autowired
    RegisterService registerService;
@RequestMapping("/PersonDetail")
    public  String  toPerson(HttpServletRequest request){
    System.out.println("===========================");
   Patient patient= (Patient) request.getSession().getAttribute("msg");
    List<Register> registers = registerService.queryAllRegisterByPid(patient);
    System.out.println("registers = " + registers);
    request.setAttribute("registerList",registers);
    return "Front_page/personalDetail";
}
}
